export const formConfig = {
	inline: false,
	showBtn: true,
	labelPosition: 'right',
	labelWidth: '120px',
	column: [
		{
			label: '角色名称',
			prop: 'roleName',
			maxlength: '50',
			showWordLimit: true,
			type: 'text',
			span: 24,
			rules: [{ required: true, message: '请输入角色名称' }],
		},
		{
			label: '角色标识',
			prop: 'roleCode',
			maxlength: '20',
			showWordLimit: true,
			type: 'text',
			span: 24,
			rules: [{ required: true, message: '请输入角色标识' }],
		},
		{
			label: '角色层级',
			prop: 'roleTier',
			type: 'remoteSelect',
			code: 'ROLE_TIER',
			api: 'getDictItemList',
			dataType: 'number',
			filterKey: 'value',
			multiple: false,
			span: 24,
			rules: [{ required: true, message: '请选择角色层级' }],
		},
		{
			label: '数据权限类型',
			prop: 'dsType',
			type: 'select',
			dicData: [
				{
					label: '全部',
					value: 0,
				},
				{
					label: '本级及子级',
					value: 2,
				},
				{
					label: '本级',
					value: 3,
				},
			],
			rules: [{ required: true, message: '请选择数据权限类型' }],
			span: 24,
		},

		{
			label: '角色描述',
			prop: 'roleDesc',
			type: 'textarea',
			maxlength: '500',
			showWordLimit: true,
			span: 24,
		},
	],
}
export const baseConfig = {
	pageName: '角色管理',
	dictcodes: ['ROLE_TIER'],
	rowKey: 'roleId',
	addLabel: '新增角色',
	tipLabel: 'roleName',
	exportMqTopic: '/ning/export/',
	api: {
		index: 'sys_role_page',
		add: 'sys_role_add',
		edit: 'sys_role_edit',
		delete: 'sys_role_del',
		export: 'sys_role_export',
	},
	auth: {
		index: 'sys_role_page',
		add: 'sys_role_add',
		edit: 'sys_role_edit',
		delete: 'sys_role_del',
		mulitSet: 'mulitSet',
		export: 'sys_role_export',
	},
	menuBtn: [
		{
			icon: 'editor',
			label: '编辑',
			type: 'primary',
			operate: 'edit',
			auth: 'sys_role_edit',
			text: true,
			show: true,
		},
		{
			icon: 'editor',
			label: '权限设置',
			type: 'primary',
			operate: 'authSet',
			auth: 'sys_role_perm',
			text: true,
			show: true,
		},
		{
			// icon: 'editor',
			label: '配置工作台',
			type: 'primary',
			operate: 'workSpace',
			auth: 'sys_role_edit',
			text: true,
			show: true,
		},
		{
			icon: 'delete',
			label: '删除',
			type: 'danger',
			operate: 'delete',
			auth: 'sys_role_del',
			text: true,
			show: true,
		},
	],
	saveFormate: async (form) => {
		return new Promise((resolve, reject) => {
			resolve(form)
		})
	},
	dialogConfig: {
		width: '75%',
	},
	searchConfig: {
		inline: true,
		showBtn: true,
		labelPosition: 'left',
		column: [
			{
				label: '角色名称',
				prop: 'roleName',
				type: 'input',
				span: 8,
			},
			{
				label: '角色标识',
				prop: 'roleCode',
				type: 'input',
				span: 8,
			},
			{
				label: '角色描述',
				prop: 'roleDesc',
				type: 'input',
				span: 8,
			},
			{
				label: '角色层级',
				prop: 'roleTier',
				type: 'remoteSelect',
				code: 'ROLE_TIER',
				api: 'getDictItemList',
				dataType: 'number',
				filterKey: 'value',
				multiple: false,
				span: 8,
			},
			{
				label: '数据权限类型',
				prop: 'dsType',
				type: 'select',
				dicData: [
					{
						label: '全部',
						value: 0,
					},
					{
						label: '本级及子级',
						value: 2,
					},
					{
						label: '本级',
						value: 3,
					},
				],
				span: 8,
			},
		],
	},
	formConfig,
	tableConfig: {
		stripe: true,
		border: true,
		maxHeight: '80vh',
		rowKey: 'roleId',
		columns: [
			{ label: '角色名称', prop: 'roleName' },
			{ label: '角色标识', prop: 'roleCode' },
			{
				label: '数据权限',
				prop: 'dsType',
				custome: 'tag',
				dicData: [
					{
						label: '全部',
						value: 0,
						type: 'success',
					},
					{
						label: '本级及子级',
						value: 2,
					},
					{
						label: '本级',
						value: 3,
					},
				],
			},
			{
				label: '角色描述',
				prop: 'roleDesc',
			},
			{
				label: '角色层级',
				prop: 'roleTier',
				custome: 'dict',
				dataType: 'number',
				code: 'ROLE_TIER',
			},
			{ label: '创建人', prop: 'creator' },
			{ label: '创建时间', prop: 'createTime' },
			{
				label: '操作',
				prop: 'menu',
				width: 300,
				fixed: 'right',
			},
		],
	},
}
